import wecatInfo from "./wecat-info";
import { ServerStatusContent } from "./server-status";
import msgVoice from "./msg-voice";
import msgVideo from "./msg-video";
import WKSDK from "wukongimjssdk";
// 注册消息类型
export const registerMsgType = () => {
  const msgTypes = [
    wecatInfo,
    // {
    //   name: "customer-in",
    //   desc: "客户发起",
    //   code: 2100,
    //   content: new ServerStatusContent(2100),
    // },
    {
      name: "server-in",
      desc: "客服加入",
      code: 2102,
      content: ServerStatusContent,
    },
    {
      name: "conversation-end",
      desc: "结束会话",
      code: 2101,
      content: ServerStatusContent,
    },
    msgVoice,
    msgVideo
  ];

  msgTypes.forEach((msgType) => {
    WKSDK.shared().register(msgType.code, () => new msgType.content(msgType.code));
  });

  console.warn(" ✔ 注册消息类型", msgTypes.map((item) => item.code).join(","));
};
